@page
@{ Layout = "_LayoutHome"; }

<el-card>
    <el-scrollbar class="scrollbar" :style="{ height: ($(window).height()-60) + 'px' }">
        <div class="pe-3">
            <div class="row g-3">
                <div class="col-xl-9 col-lg-9 col-md-9 col-9 border-end border-1 border-light">
                    <div class="pe-3" v-if="total>0">
                        <div class="row g-4">
                            <div class="col-xl-4 col-lg-4 col-md-4 col-4">
                                <div class="card card-lift card-hover border bg-white p-2 mb-3" v-on:click="btnViewClick(course)" style="cursor:pointer;" v-for="course in list1">
                                    <div class="position-relative">
                                        <img :src="course.coverImg" class="img-fluid card-img">
                                        <span class="px-2 rounded-3 bg-dark text-white position-absolute bottom-0 end-0 m-2 fs-6">{{ utils.formatDuration(course.duration) }}</span>
                                        <el-tag size="mini" type="success" effect="dark" class="position-absolute top-0 end-0 m-2" v-if="course.state==='Yiwancheng'">{{ course.stateStr }}</el-tag>
                                        <el-tag size="mini" type="warning" effect="dark" class="position-absolute top-0 end-0 m-2" v-else>{{ course.stateStr }}</el-tag>
                                        <span class="position-absolute bottom-0 start-0 m-2">
                                            <el-tag size="mini" type="primary" effect="dark" class="me-1">{{ course.courseType}}</el-tag>
                                            <el-tag size="mini" type="primary" effect="plain" v-if="course.offLine">面授课</el-tag>
                                        </span>
                                    </div>
                                    <div class="card-body">
                                        <h4 class="mb-3">
                                            <a href="javascript:;" class="text-inherit">{{ course.name }}</a>
                                        </h4>
                                        <div class="mb-3 lh-1">
                                            <span>
                                                <i class="bi bi-star-fill text-warning me-2"></i>
                                                <span class="text-inherit fw-semibold">{{ course.evaluationAvg }}</span>
                                            </span>
                                            <span class="mx-1">
                                                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
                                                     fill="var(--gk-gray-400)" class="bi bi-dot" viewBox="0 0 16 16">
                                                    <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"></path>
                                                </svg>
                                            </span>
                                            <span>
                                                <i class="bi bi-person-video3 me-2"></i>
                                                <span class="text-inherit fw-semibold">{{ course.totaEvaluationlUser }}</span>
                                            </span>
                                        </div>
                                        <div class="lh-1">
                                            <i class="bi bi-credit-card-2-front-fill me-2"></i><span class="text-inherit fw-semibold">{{ course.studyHour }}</span> 课时
                                            <span class="mx-1">
                                                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
                                                     fill="var(--gk-gray-400)" class="bi bi-dot" viewBox="0 0 16 16">
                                                    <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"></path>
                                                </svg>
                                            </span>
                                            <span class="text-inherit fw-semibold text-success" v-if="course.state==='Yiwancheng'">{{ course.credit }}学分</span>
                                            <span class="text-inherit fw-semibold" v-else>{{ course.credit }}学分</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-xl-4 col-lg-4 col-md-4 col-4">
                                <div class="card card-lift card-hover border bg-white p-2 mb-3" v-on:click="btnViewClick(course)" style="cursor:pointer;" v-for="course in list2">
                                    <div class="position-relative">
                                        <img :src="course.coverImg" class="img-fluid card-img">
                                        <span class="px-2 rounded-3 bg-dark text-white position-absolute bottom-0 end-0 m-2 fs-6">{{ utils.formatDuration(course.duration) }}</span>
                                        <el-tag size="mini" type="success" effect="dark" class="position-absolute top-0 end-0 m-2" v-if="course.state==='Yiwancheng'">{{ course.stateStr }}</el-tag>
                                        <el-tag size="mini" type="warning" effect="dark" class="position-absolute top-0 end-0 m-2" v-else>{{ course.stateStr }}</el-tag>
                                        <span class="position-absolute bottom-0 start-0 m-2">
                                            <el-tag size="mini" type="primary" effect="dark" class="me-1">{{ course.courseType}}</el-tag>
                                            <el-tag size="mini" type="primary" effect="plain" v-if="course.offLine">面授课</el-tag>
                                        </span>
                                    </div>
                                    <div class="card-body">
                                        <h4 class="mb-3">
                                            <a href="javascript:;" class="text-inherit">{{ course.name }}</a>
                                        </h4>
                                        <div class="mb-3 lh-1">
                                            <span>
                                                <i class="bi bi-star-fill text-warning me-2"></i>
                                                <span class="text-inherit fw-semibold">{{ course.evaluationAvg }}</span>
                                            </span>
                                            <span class="mx-1">
                                                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
                                                     fill="var(--gk-gray-400)" class="bi bi-dot" viewBox="0 0 16 16">
                                                    <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"></path>
                                                </svg>
                                            </span>
                                            <span>
                                                <i class="bi bi-person-video3 me-2"></i>
                                                <span class="text-inherit fw-semibold">{{ course.totaEvaluationlUser }}</span>
                                            </span>
                                        </div>
                                        <div class="lh-1">
                                            <i class="bi bi-credit-card-2-front-fill me-2"></i><span class="text-inherit fw-semibold">{{ course.studyHour }}</span> 课时
                                            <span class="mx-1">
                                                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
                                                     fill="var(--gk-gray-400)" class="bi bi-dot" viewBox="0 0 16 16">
                                                    <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"></path>
                                                </svg>
                                            </span>
                                            <span class="text-inherit fw-semibold text-success" v-if="course.state==='Yiwancheng'">{{ course.credit }}学分</span>
                                            <span class="text-inherit fw-semibold" v-else>{{ course.credit }}学分</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-xl-4 col-lg-4 col-md-4 col-4">
                                <div class="card card-lift card-hover border bg-white p-2 mb-3" v-on:click="btnViewClick(course)" style="cursor:pointer;"  v-for="course in list3">
                                    <div class="position-relative">
                                        <img :src="course.coverImg" class="img-fluid card-img">
                                        <span class="px-2 rounded-3 bg-dark text-white position-absolute bottom-0 end-0 m-2 fs-6">{{ utils.formatDuration(course.duration) }}</span>
                                        <el-tag size="mini" type="success" effect="dark" class="position-absolute top-0 end-0 m-2" v-if="course.state==='Yiwancheng'">{{ course.stateStr }}</el-tag>
                                        <el-tag size="mini" type="warning" effect="dark" class="position-absolute top-0 end-0 m-2" v-else>{{ course.stateStr }}</el-tag>
                                        <span class="position-absolute bottom-0 start-0 m-2">
                                            <el-tag size="mini" type="primary" effect="dark" class="me-1">{{ course.courseType}}</el-tag>
                                            <el-tag size="mini" type="primary" effect="plain" v-if="course.offLine">面授课</el-tag>
                                        </span>
                                    </div>
                                    <div class="card-body">
                                        <h4 class="mb-3">
                                            <a href="javascript:;" class="text-inherit">{{ course.name }}</a>
                                        </h4>
                                        <div class="mb-3 lh-1">
                                            <span>
                                                <i class="bi bi-star-fill text-warning me-2"></i>
                                                <span class="text-inherit fw-semibold">{{ course.evaluationAvg }}</span>
                                            </span>
                                            <span class="mx-1">
                                                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
                                                     fill="var(--gk-gray-400)" class="bi bi-dot" viewBox="0 0 16 16">
                                                    <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"></path>
                                                </svg>
                                            </span>
                                            <span>
                                                <i class="bi bi-person-video3 me-2"></i>
                                                <span class="text-inherit fw-semibold">{{ course.totaEvaluationlUser }}</span>
                                            </span>
                                        </div>
                                        <div class="lh-1">
                                            <i class="bi bi-credit-card-2-front-fill me-2"></i><span class="text-inherit fw-semibold">{{ course.studyHour }}</span> 课时
                                            <span class="mx-1">
                                                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
                                                     fill="var(--gk-gray-400)" class="bi bi-dot" viewBox="0 0 16 16">
                                                    <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"></path>
                                                </svg>
                                            </span>
                                            <span class="text-inherit fw-semibold text-success" v-if="course.state==='Yiwancheng'">{{ course.credit }}学分</span>
                                            <span class="text-inherit fw-semibold" v-else>{{ course.credit }}学分</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="my-5 text-center">
                            <el-button icon="el-icon-refresh-right" v-if="total>pushTotal" v-on:click="btnLoadMoreClick" :loading="loadMoreLoading">加载更多</el-button>
                            <small v-else>没有更多了</small>
                        </div>
                    </div>
                    <div class="pt-10" v-else>
                        <el-empty image="/sitefiles/assets/images/nodata.svg" description="暂无课程上架"></el-empty>
                    </div>
                </div>
                <div class="col-xl-3 col-lg-3 col-md-3 col-3">
                    <div class="card border mb-6 mb-md-0 shadow-none sticky-top">
                        <div class="card-header">
                            <h4 class="mb-0 fs-5">
                                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-filter me-2" viewBox="0 0 16 16">
                                    <path d="M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"></path>
                                </svg>
                                课程查询
                            </h4>
                        </div>
                        <div class="card-body border-top py-3">
                            <div class="d-flex justify-content-between mt-2 text-dark">
                                <el-select v-model="form.state" clearable placeholder="学习状态" class="w-100">
                                    <el-option label="全部状态"
                                               value="">
                                    </el-option>
                                    <el-option label="已完成"
                                               value="stateOver">
                                    </el-option>
                                    <el-option label="学习中"
                                               value="stateStuding">
                                    </el-option>
                                </el-select>
                            </div>
                        </div>
                        <div class="card-body border-top py-3">
                            <div class="d-flex justify-content-between mt-2 text-dark">
                                <el-select v-model="form.orderby" clearable placeholder="默认排序" class="w-100">
                                    <el-option label="默认排序"
                                               value="">
                                    </el-option>
                                    <el-option label="按评价"
                                               value="orderbyEvaluation">
                                    </el-option>
                                    <el-option label="按学习人数"
                                               value="orderbyCount">
                                    </el-option>
                                </el-select>
                            </div>
                        </div>
                        <div class="card-body border-top py-3">
                            <div class="mt-2 text-dark">
                                <div>
                                    <el-checkbox v-model="form.collection">
                                        <i class="bi bi-person-hearts me-2"></i>我的收藏
                                    </el-checkbox>
                                </div>
                                <div class="my-3">
                                    <el-input clearable prefix-icon="el-icon-search" v-model="form.keyWords" placeholder="关键字" class="w-100"></el-input>
                                </div>
                                <div v-if="markTotal>0" class="mt-1 p-2 bg-light rounded-3">
                                    <template v-for="mark in markShowList">
                                        <el-tag v-if="form.mark===mark" size="mini" class="me-1 mb-1" v-on:click="marChangeClick(mark)" effect="dark" type="success" style="cursor:pointer;">{{ mark }}</el-tag>
                                        <el-tag v-else size="mini" class="me-1 mb-1" v-on:click="marChangeClick(mark)" style="cursor:pointer;" effect="plain">{{ mark }}</el-tag>
                                    </template>
                                    <el-tag size="mini" v-on:click="moreMarkList" type="info" effect="plain" v-if="markMore" style="cursor:pointer;">more({{ markTotal-markShowList.length }})</el-tag>
                                </div>
                            </div>
                        </div>
                        <div class="card-body border-top py-3">
                            <div class="p-2 bg-light rounded-pill">
                                <el-button type="primary" plain icon="el-icon-search" v-on:click="btnSearchClick" class="w-100 rounded-pill">查询</el-button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </el-scrollbar>
</el-card>

@section Scripts{
    <script src="/sitefiles/assets/js/home/study/studyCourse.js" type="text/javascript"></script>
}